from django.shortcuts import render

from author.models import Author


# Create author views here.


def author_detail(request, aid):
    """ 根据 aid 获取作者 """
    author = Author.objects.get(id=aid)
    # 补充：列出该作者写的所有书，这里我直接在前端去写
    context = {
        'author': author,
    }
    return render(request, 'author/author-detail.html', context)

